import pandas as pd
import urllib.parse
from sqlalchemy import create_engine
# 读取 Excel
df = pd.read_excel(r'./DATA/评标结果汇总表.xls')


password = "sl2596600@SL"  # 原始密码含@
encoded_password = urllib.parse.quote_plus(password)  # 编码后变为 "p%40ssword"

# 连接 MySQL - 使用 pymysql 驱动
engine = create_engine('mysql+pymysql://ai:{encoded_password}@rm-bp10j3h4c57g87gq4eo.mysql.rds.aliyuncs.com/ai')

# 导入数据（自动建表或追加）
df.to_sql('评标结果汇总表', engine, if_exists='replace', index=False)
